﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;

namespace Phoenix.Backend
{
    public partial class Permission : System.Web.UI.Page
    {
        protected string idusers="0";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                try
                {
                    if (Request.QueryString["ID"].ToString() == null || Request.QueryString["ID"].ToString() == "")
                    {
                        Response.Redirect("Users.aspx");
                    }
                    else
                    {
                        idusers = Request.QueryString["ID"].ToString();

                        if (Request.QueryString["Action"] == "AddPermission")
                        {
                            Phoenix.AppCode.Bussiness.UsersService.AddPermisson(idusers, Convert.ToInt32(Request.QueryString["IDML"].ToString()));
                            Response.Redirect("Permission.aspx?ID=" + idusers + "");
                        }
                    }
                }
                catch (FormatException)
                {
                    Response.Redirect("Error.aspx");
                }
            }
        }
    }
}